11516 - WiFi (Binary search + greedy)
[andmenj-acm.git] / 11482 - Building a Triangular Museum / museum.cpp
blobcf63f63fbcd8a12bfdd052f0da1156a0efe21344
1 #include <iostream>
3 using namespace std;
5 void ponerEsp(int esp) {
6 for(int i =0; i<esp;++i) {
7 cout << " ";
11 void ponerLinea(int esp) {
12 for(int i =0; i<esp;++i) {
13 cout << "_";
17 int main() {
18 int m,n;
19 cin >> m >> n;
20 int count = 1;
21 while(m!=0) {
22 cout << "Triangular Museum " << count++ << endl;
23 int espIni = (n*m)-1;
24 for(int i =1; i<=n; ++i) {
25 int espEntre = 2*(m-1);
26 for(int r= 1; r<=m; ++r) {
27 ponerEsp(espIni);
28 espIni--;
29 for(int j=1; j<=i; ++j) {
30 cout << "/";
31 if(r==m) ponerLinea(2*(m-1));
32 else ponerEsp(2*(r-1));
33 cout << "\\";
34 if((j+1)<=i) {
35 ponerEsp(espEntre);
38 espEntre -= 2;
39 cout << endl;
42 cout << endl;
43 cin >> m >> n;
45 return 0;